//
//  MainGuideCollectionViewCell.m
//  Camera
//
//  Created by aaaaaa on 16/8/10.
//  Copyright © 2016年 葛海一. All rights reserved.
//

#import "MainGuideCollectionViewCell.h"

@interface MainGuideCollectionViewCell ()

@property (nonatomic, retain) UIImageView *imageView;
@property (nonatomic, retain) BaseLabel *titlelable;



@end

@implementation MainGuideCollectionViewCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createSubViews];
        
    }
    return self;
}

- (void)createSubViews{
    
    self.contentView.backgroundColor = [UIColor clearColor];
    
    self.imageView = [[UIImageView alloc] init];
    [self.contentView addSubview:_imageView];
    
    [self.imageView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.height.mas_equalTo(HEIGHT_ITEM * 0.5);
        make.right.equalTo(self.contentView.mas_left).offset(WIDTH_ITEM * 0.4);
        make.width.mas_equalTo(HEIGHT_ITEM * 0.5);
    }];
    
    self.titlelable = [[BaseLabel alloc] init];
    [self.contentView addSubview:_titlelable];
    
    [self.titlelable mas_remakeConstraints:^(MASConstraintMaker *make) {
       
        make.centerY.equalTo(self.imageView.mas_centerY);
        make.height.mas_equalTo(self.imageView.mas_height);
        make.left.equalTo(self.imageView.mas_right);
        make.width.mas_equalTo(WIDTH_ITEM * 0.3);
        
    }];
    self.titlelable.textColor = [UIColor whiteColor];
    self.titlelable.textAlignment = NSTextAlignmentCenter;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    self.imageView.image = [UIImage imageNamed:self.imageName];
    self.titlelable.text = self.titleStr;
    
}
















@end
